{template '_header'}

<div class="page-header">当前位置：<span class="text-primary">创业者管理</span></div>

<div class="page-content">
<form action="./index.php" method="get" class="form-horizontal" role="form" id="form1">
    <input type="hidden" name="c" value="site" />
    <input type="hidden" name="a" value="entry" />
    <input type="hidden" name="m" value="mx_shop" />
    <input type="hidden" name="do" value="web" />
    <input type="hidden" name="r" value="sgoods.ownerlist" />

    <div class="page-toolbar">

        <div class="col-sm-7">
            <div class="btn-group btn-group-sm" style='float:left;'>
                <button class="btn btn-default btn-sm"  type="button" data-toggle='refresh'><i class='fa fa-refresh'></i></button>
            </div>
        </div>

        <div class="col-sm-5 pull-right">
            <div class="input-group">
                <div class="input-group-select">
                    <select name='searchfield' class='form-control  input-sm select-md' style="width:120px;"  >
                        <option value="member" {if $_GPC['searchfield']=='member'}selected{/if}>会员信息</option>
                        <option value="goods" {if $_GPC['searchfield']=='goods'}selected{/if}>设备名称</option>
                    </select>
                </div>
                <input type="text" class="form-control input-sm"  name="keyword" value="{$_GPC['keyword']}" placeholder="请输入关键词"/>
                <span class="input-group-btn">
                    <button class="btn btn-sm btn-primary" type="submit"> 搜索</button>
                </span>
            </div>
        </div>
    </div>
</form>

{if count($list)>0}

<table class="table table-hover table-responsive">
    <thead class="navbar-inner" >
    <tr>
        <th style='width:80px;'>创业者</th>
        <th style='width:80px;'>头像</th>
        <th style='width:80px;'>电话</th>
        <th style='width:80px;'>所在地</th>
        <th style='width:80px;'>设备数</th>
        <th style='width:80px;'>累计佣金</th>
        <th style='width:80px;'>操作</th>
    </tr>
    </thead>
    <tbody>
    {loop $list $row}
    <tr>
        <td >
            <span><a {ifp 'user.list.view'}href="{php echo webUrl('user/list/detail',array('id'=>$row['mid']))}"
                     target='_blank'{/if}>{if !empty($row['realname'])} {$row['realname']}{/if}</a></span>
        </td>

        <td >
            <img src="{$row['avatar']}" style="width:70px;">
        </td>

        <td >
            <span>{$row['mobile']}</span>
        </td>

        <td >
            <span>{if !empty($row['province'])} {$row['province']} {if !empty($row['city'])} - {$row['city']}{/if} {/if}</span>
        </td>
        <td >
            <span><a {ifp 'sgoods.main'}href="{php echo webUrl('sgoods', array('uid'=>$row['uid']))}"{/if}>{$row['goods']} </a></span>
        </td>

        <td >
            {ifp 'sorder.commission.commlog'}
            {if !empty($row['comid'])}
            <span><a href="{php echo webUrl('sorder/commission/commlog', array('id'=>$row['comid']))}">{$row['comm']} 元</a></span>
            {else}
            <span>{$row['comm']} 元</span>
            {/if}
            {else}
            <span>{$row['comm']} 元</span>
            {/if}
        </td>

        <td style="overflow:visible;">
            <div class="btn-group btn-group-sm" >
                <a class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="javascript:;">操作 <span class="caret"></span></a>
                <ul class="dropdown-menu dropdown-menu-left" role="menu" style='z-index: 9999'>

                    {ifp 'user.list.detail'}
                    <li><a href="{php echo webUrl('user/list/detail',array('id' => $row['mid']));}" title="会员详情"><i class='fa fa-edit'></i> 会员详情</a></li>
                    {/if}

                    {ifp 'sgoods.main'}
                    <li><a href="{php echo webUrl('sgoods',array('uid'=>$row['uid']))}" title='设备列表'><i class='fa fa-list'></i> 设备列表</a></li>
                    {/if}

                    {ifp 'sorder.commission.commlog'}
                    {if !empty($row['comid'])}
                    <li><a href="{php echo webUrl('sorder/commission/commlog', array('id'=>$row['comid']))}" title='佣金明细'><i class='fa fa-money'></i> 佣金明细</a></li>
                    {/if}
                    {/if}
                </ul>
            </div>
        </td>
    </tr>
    {/loop}
    </tbody>
</table>
{$pager}

    {else}
    <div class="panel panel-default">
        <div class="panel-body empty-data">未查询到相关数据</div>
    </div>
    {/if}
</div>


{template '_footer'}